package com.cbwl.eoas.common.framework.exception;

import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.file.ExceptionPropertiesUtil;

/**
 * <p>[描述信息：自定义异常类]</p>
 *
 * @author yuyunbo
 * @version 1.0 Created on 2015-5-1 下午05:23:20
 */
public class CustomException extends Exception {

	private static final long serialVersionUID = -4500104522114673089L;

	// 异常代码
	private String code;

	// 异常信息
	private String msg;

	public CustomException() {
		super();
	}

	public CustomException(String code) {
		this.code = code;
		if(!StringUtils.isEmpty(code)){
			this.msg = ExceptionPropertiesUtil.getExceptionDesc(code);
		}
	}

	public CustomException(String code, String msg) {
		super(msg);
		this.code = code;
		this.msg = msg;
	}

	public CustomException(String msg, Throwable cause) {
		super(msg, cause);
	}

	public CustomException(Throwable cause) {
		super(cause);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
